home *** CD-ROM | disk | FTP | other *** search
/ Programming an RTS Game with Direct3D / Programming an RTS Game with Direct3D.iso / Examples / Chapter 4 / Example 4.4 / heightMap.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-06-29  |  589 b   |  27 lines

  1. #ifndef _HEIGHTMAP_
  2. #define _HEIGHTMAP_
  3.  
  4. #include <d3dx9.h>
  5. #include "intpoint.h"
  6.  
  7. struct HEIGHTMAP
  8. {
  9.     //Functions
  10.     HEIGHTMAP(INTPOINT _size, float _maxHeight);
  11.     ~HEIGHTMAP();
  12.     void Release();
  13.     void operator*=(const HEIGHTMAP &rhs);
  14.  
  15.     HRESULT LoadFromFile(IDirect3DDevice9* Device, char fileName[]);
  16.     HRESULT CreateRandomHeightMap(int seed, float noiseSize, float persistence, int octaves);
  17.     void RaiseTerrain(RECT r, float f);
  18.     void SmoothTerrain();
  19.     void Cap(float capHeight);
  20.  
  21.     //variables
  22.     INTPOINT m_size;
  23.     float m_maxHeight;
  24.     float *m_pHeightMap;
  25. };
  26.  
  27. #endif